package com.yanqu.road.entity.player;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

@FieldTypeAnnotation(tableName = "t_u_thief")
public class UserThief extends DataObject {

    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "小偷UID", update = true)
    private String thiefUid = "";

    @FieldTypeAnnotation(desc = "小偷类型")
    private int type;

    @FieldTypeAnnotation(desc = "小偷作案位置")
    private int crimePlaceId;

    @FieldTypeAnnotation(desc = "打工开始时间，0表示未被抓")
    private long workBeginTime;

    @FieldTypeAnnotation(desc = "创建时间")
    private long createTime;

    @FieldTypeAnnotation(desc = "是否领奖")
    private boolean getReward;

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public void setThiefUid(String thiefUid) {
        if (null == thiefUid) {
            return;
        }
        if (!this.thiefUid.equals(thiefUid)) {
            this.thiefUid = thiefUid;
            setOp(DataStatus.Update);
        }
    }

    public void setType(int type) {
        if (this.type != type) {
            this.type = type;
            setOp(DataStatus.Update);
        }
    }

    public void setCrimePlaceId(int crimePlaceId) {
        if (this.crimePlaceId != crimePlaceId) {
            this.crimePlaceId = crimePlaceId;
            setOp(DataStatus.Update);
        }
    }

    public void setWorkBeginTime(long workBeginTime) {
        if (this.workBeginTime != workBeginTime) {
            this.workBeginTime = workBeginTime;
            setOp(DataStatus.Update);
        }
    }

    public void setCreateTime(long createTime) {
        if (this.createTime != createTime) {
            this.createTime = createTime;
            setOp(DataStatus.Update);
        }
    }

    public void setGetReward(boolean getReward) {
        if (this.getReward != getReward) {
            this.getReward = getReward;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public String getThiefUid() {
        return thiefUid;
    }

    public int getType() {
        return type;
    }

    public int getCrimePlaceId() {
        return crimePlaceId;
    }

    public long getWorkBeginTime() {
        return workBeginTime;
    }

    public long getCreateTime() {
        return createTime;
    }

    public boolean isGetReward() {
        return getReward;
    }
}
